package com.ruoyi.system.service.impl;

/**
 * @ProjectName: RuoYi-Vue-master
 * @Package: com.ruoyi.system.service.impl
 * @ClassName: PointsLogServiceImpl
 * @Author: EdwardX
 * @Description:
 * @Date: 2024/5/17 16:08
 * @Version: 1.0
 */

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.mapper.PointsLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.domain.PointsLog;
import com.ruoyi.system.service.IPointsLogService;

/**
 * 积分明细Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-12
 */
@Service
public class PointsLogServiceImpl implements IPointsLogService
{
    @Autowired
    private PointsLogMapper pointsLogMapper;

    /**
     * 查询积分明细
     *
     * @param id 积分明细主键
     * @return 积分明细
     */
    @Override
    public PointsLog selectPointsLogById(Long id)
    {
        return pointsLogMapper.selectPointsLogById(id);
    }

    /**
     * 查询积分明细列表
     *
     * @param pointsLog 积分明细
     * @return 积分明细
     */
    @Override
    public List<PointsLog> selectPointsLogList(PointsLog pointsLog)
    {
        return pointsLogMapper.selectPointsLogList(pointsLog);
    }

    /**
     * 新增积分明细
     *
     * @param pointsLog 积分明细
     * @return 结果
     */
    @Override
    public int insertPointsLog(PointsLog pointsLog)
    {
        pointsLog.setCreateTime(DateUtils.getNowDate());
        return pointsLogMapper.insertPointsLog(pointsLog);
    }

    /**
     * 修改积分明细
     *
     * @param pointsLog 积分明细
     * @return 结果
     */
    @Override
    public int updatePointsLog(PointsLog pointsLog)
    {
        return pointsLogMapper.updatePointsLog(pointsLog);
    }

    /**
     * 批量删除积分明细
     *
     * @param ids 需要删除的积分明细主键
     * @return 结果
     */
    @Override
    public int deletePointsLogByIds(Long[] ids)
    {
        return pointsLogMapper.deletePointsLogByIds(ids);
    }

    /**
     * 删除积分明细信息
     *
     * @param id 积分明细主键
     * @return 结果
     */
    @Override
    public int deletePointsLogById(Long id)
    {
        return pointsLogMapper.deletePointsLogById(id);
    }

    @Override
    public List<PointsLog> listPointsLogByUserId(Long userId) {
        return pointsLogMapper.listPointsLogByUserId(userId);
    }
}

